//------------------------------------------------------------------------------------------
//	Copyright and Disclaimer Notice
//
//	Copyright (c) 2013 A.C. Verbeck
//
//	This file is part of dsp_lab: A DSP laboratory
//
//	dsp_lab is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	dsp_lab is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with dsp_lab.  If not, see <http://www.gnu.org/licenses/>.
//
//------------------------------------------------------------------------------------------

#include <math.h>
#include <stdio.h>
#include <stdlib.h>

#define LENGTH 1024

#define PI	3.14159265358979323846
#define TAU	6.283185307179586476925286766559

//------------------------------------------------------------------------------------------
//	Main application
//------------------------------------------------------------------------------------------
int main()
{
	int i;
	short data[LENGTH + 2];
	FILE *fd;

	fd = fopen("sinewave.raw","wb");
	for (i=0; i<LENGTH; i++)
		data[i] = 32767 * sin(i * TAU / (double) LENGTH);
	fwrite(&data,2,LENGTH,fd);
	fclose(fd);
	return 0;
}
